const db = require('./db_connect');

function db_query(sql,arrData='',res,callback=''){

    db(sql,arrData).then((data)=>{
        if(callback){
            callback(null,data)
        }
    }).catch((err)=>{
        console.log('err',err);
        console.log(sql);
        res.send({
            code:'500',
            message:'请求失败',
            data:err
        })
    })
}

module.exports = db_query